﻿<Window x:Class="ShareDeployed.Mailgrabber.View.CreateGroupView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:conv="clr-namespace:ShareDeployed.Mailgrabber.Converters"
        Title="Create group" Height="270" Width="300" 
		DataContext="{Binding Source={StaticResource Locator}, Path=CreateGroupVM}">
	<Window.Resources>
		<conv:ReverseBoolToVisibility x:Key="ReverseConv"/>
	</Window.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition/>
			<RowDefinition/>
			<RowDefinition/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.5*"/>
			<ColumnDefinition/>
		</Grid.ColumnDefinitions>
		<TextBlock Text="New group name:" VerticalAlignment="Center"/>
		<TextBox Text="{Binding Path=NewGroup.GroupName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"	
				VerticalAlignment="Center"/>

		<TextBlock Text="Creator name:" VerticalAlignment="Center" Grid.Row="1"/>
		<TextBox Text="{Binding Path=NewGroup.CreatorName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"	
				Grid.Row="1" VerticalAlignment="Center" IsReadOnly="True"/>

		<TextBlock Text="Is private:" VerticalAlignment="Center" Grid.Row="2"/>
		<CheckBox IsChecked="{Binding Path=NewGroup.Private,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"	
				Grid.Row="2" VerticalAlignment="Center"/>

		<Expander Grid.Row="3" Header="Add users" Grid.ColumnSpan="2"></Expander>
		
		<Button Grid.Row="4" Grid.ColumnSpan="2" Height="29" Command="{Binding CreateCommand}"
				Content="Create" Visibility="{Binding IsCreated,Converter={StaticResource ReverseConv}}"/>
	</Grid>
</Window>
